
import { Bullet } from './bullet';
import {organism} from './base'

class Npc extends organism{
    // 运动轨迹,line直线
    trajectory:string = 'line'
    // 运动角度   直线
    lineAngle:number = 0
    // 颜色
    color:string='#fff'
    // 减少生命值
    dechp(num:number){
        this.hp -= num
        if (this.hp<=0)
            this.status = 2
    }
    // 增加生命值
    inchp(num:number){
        this.hp += num
    }
    constructor(jsonObj: { [key: string]: any }){
        super()
        for (let key in jsonObj) {
            if (key in this) {
                this[key] = jsonObj[key];
            } 
        }
    }
}

class red_npc extends Npc{
    img = '/src/assets/plan_red.png'
    rectangle = [40,40]
}



export {red_npc}